package com.zzt.zt_hilt.service;

import com.zzt.zt_hilt.Module.MyWeather;
import com.zzt.zt_hilt.retrofit.ApiRetrofitUtils;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * @author: zeting
 * @date: 2020/12/7
 */
public interface WheatherApi {

    static WheatherApi getApi() {
        String baseUrl = "https://search.heweather.com";
        return ApiRetrofitUtils.getInstance().getApiService(baseUrl, WheatherApi.class);
    }

    /**
     * 天气预报
     */
    // https://search.heweather.com/find?location=北京&key=4b61a68895b149f1a5ea53fe43782e17
    @GET("/find?key=4b61a68895b149f1a5ea53fe43782e17")
    Call<MyWeather> getWheatherBeiJin(@Query("location") String location);


    /**
     * 天气预报
     */
    //https://search.heweather.com/top?group=cn&key=4b61a68895b149f1a5ea53fe43782e17&number=20
    @GET("top?key=4b61a68895b149f1a5ea53fe43782e17")
    Call<MyWeather> getWheatherGroup(@Query("group") String group, @Query("number") String number);

}
